<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:spring="http://www.springframework.org/tags" version="2.0">
	<jsp:directive.page contentType="text/html; charset=UTF-8"
		pageEncoding="UTF-8" session="true" />
	<jsp:output doctype-root-element="html"
		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
		omit-xml-declaration="true" />
	<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><spring:message code="page.updateCar.title" /> <c:if
		test="${car ne null}">
		<c:out value="${car.model}" />
	</c:if></title>
</head>
<body>
	<c:import url="header.jsp" />

	<c:if test="${car ne null}">
		<div>
			<spring:message code="page.change" var="buttonChange" />
			<table>
				<br />
				<c:url value="/admin/updateCar" var="updateReq" />
				<FORM action="${updateReq}" method="post">
					<INPUT type="hidden" value="${car.carId}" name="carId" />
					<tr>
						<td><spring:message code="adminpage.addCarForm.model" /> :</td>
						<td><INPUT type="text" name="cModel" value="${car.model}" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.year" /> :</td>
						<td><INPUT type="text" name="cYear" value="${car.year}" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.color" /> :</td>
						<td><select name="cColor">
								<OPTION value="${car.color}">Current:
									<c:out value="${car.color}" /></OPTION>
								<option value="red"><spring:message
										code="adminpage.addCarForm.colorselect.red" /></option>
								<option value="blue"><spring:message
										code="adminpage.addCarForm.colorselect.blue" /></option>
								<option value="white"><spring:message
										code="adminpage.addCarForm.colorselect.white" /></option>
								<option value="black"><spring:message
										code="adminpage.addCarForm.colorselect.black" /></option>
								<option value="silver"><spring:message
										code="adminpage.addCarForm.colorselect.silver" /></option>
						</select></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.engineVolume" />
							:</td>
						<td><INPUT type="number" name="cEngineVolume"
							value="${car.engineVolume}" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.tankCapacity" />
							:</td>
						<td><INPUT type="number" name="cTankCapacity"
							value="${car.tankCapacity}" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.power" /> :</td>
						<td><INPUT type="number" name="cPower" value="${car.power}" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.consumption" />
							:</td>
						<td><INPUT type="text" name="cConsumption"
							value="${car.consumption }" /></td>
					</tr>
					<tr>
						<td><spring:message code="adminpage.addCarForm.gearbox" /> :</td>
						<td><select name="cGearbox">
								<option value="${car.gearbox}">Current:
									<c:out value="${car.gearbox}" /></option>
								<option value="manual"><spring:message
										code="adminpage.addCarForm.gearboxselect.manual" /></option>
								<option value="auto"><spring:message
										code="adminpage.addCarForm.gearboxselect.auto" /></option>
						</select></td>
					</tr>
					<tr>
						<td><spring:message code="page.car.price" /></td>
						<td><input name="cPrice" value="${car.price}" type="text" />
						</td>
					</tr>
					<tr>
						<td id="output"><INPUT type="submit" value="${buttonChange}" /></td>
					</tr>
				</FORM>
			</table>
		</div>
	</c:if>
</body>
	</html>
</jsp:root>